package org.idea.qiyu.framework.canal.split.table;

import org.apache.commons.lang.math.RandomUtils;
import org.idea.qiyu.common.annotations.QiyuBootApplication;
import org.idea.qiyu.framework.canal.split.table.mapper.UserMapper;
import org.idea.qiyu.framework.canal.split.table.po.UserPO;
import org.idea.qiyu.framework.canal.split.table.service.UserService;
import org.idea.qiyu.framework.sqlsession.factory.mapping.annotations.EnableMultiSqlSessionFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * 分库分表案例
 *
 * @Author linhao
 * @Date created in 7:44 下午 2021/6/21
 */
@QiyuBootApplication
@EnableMultiSqlSessionFactory
public class SplitTableApplication implements CommandLineRunner {

    @Resource
    private UserMapper userMapper;

    public static void main(String[] args) {
        SpringApplication.run(SplitTableApplication.class);
    }

    @Override
    public void run(String... args) throws Exception {
//        for(int i=0;i<1000;i++){
//            userMapper.insert(Long.valueOf(RandomUtils.nextInt()), UUID.randomUUID().toString());
//        }
    }
}
